import http from '@/utils/request'

/**
 * 查询企业的部门列表
 */
export const reqGetDepartments = () => {
  return http({
    url: '/company/department',
    method: 'get'
  })
}

/**
 * 根据ID删除部门
 * @param {*} id 部门id
 */
export const reqDelDepartments = (id) => {
  return http({
    url: `/company/department/${id}`,
    method: 'delete'
  })
}

/**
 * 新增部门
 * @param {*} obj { pid, name, code, manager, introduce}
 */
export const reqAddDepartments = (obj) => {
  return http({
    url: '/company/department',
    method: 'post',
    data: obj
  })
}
